import Vue from 'vue'
import Router from 'vue-router'
import item1 from '@/components/item/item1'
import item2 from '@/components/item/item2'
import item3 from '@/components/item/item3'
import item4 from '@/components/item/item4'
import header from '@/components/Headergl/Header'
import shop from '@/components/shop'
import shangpinxiangqing from '@/components/shangpinxiangqing'
import header2 from '@/components/Headergl/Header2'
import jieshao from '@/components/jieshao'
import dingdan from '@/components/dingdan'
import quanbudingdan from '@/components/quanbudingdan'
import pingjia from '@/components/pingjia'
import dingdan2 from '@/components/dingdan2'
import daifukuan from '@/components/daifukuan'
import dingdanitem1 from '@/components/dingdanitem/dingdanitem1'
import dingdanitem2 from '@/components/dingdanitem/dingdanitem2'
import dingdanitem3 from '@/components/dingdanitem/dingdanitem3'
import dingdanitem4 from '@/components/dingdanitem/dingdanitem4'
import dizhi from '@/components/myitem/dizhi'
import chaxun from '@/components/myitem/chaxun'
import shopitem from '@/components/myitem/shopitem'
Vue.use(Router)
const originalPush = Router.prototype.push
Router.prototype.push = function push (location) {
  return originalPush.call(this, location).catch(err => err)
}
export default new Router({
  routes: [
    {
      path: '/item1',
      name: 'item1',
      component: item1
    },
    {
      path: '/item2',
      name: 'item2',
      component: item2
    },
    {
      path: '/item3',
      name: 'item3',
      component: item3
    },
    {
      path: '/item4',
      name: 'item4',
      component: item4
    },
    {
      path: '/header',
      name: 'header',
      component: header
    },
    {
      path: '/shop',
      name: 'shop',
      component: shop
    },
    {
      path: '/shangpinxiangqing/:name',
      name: 'shangpinxiangqing',
      component: shangpinxiangqing
    },
    {
      path: '/header2',
      name: 'header2',
      component: header2
    },
    {
      path: '/jieshao',
      name: 'jieshao',
      component: jieshao
    },
    {
      path: '/dingdan/:jiage',
      name: 'dingdan',
      component: dingdan
    },
    {
      path: '/quanbudingdan/:index',
      name: 'quanbudingdan',
      component: quanbudingdan
    },
    {
      path: '/pingjia/:index',
      name: 'pingjia',
      component: pingjia
    },
    {
      path: '/dingdan2/:jiage/:name/:num/:nc/:yanse/:address',
      name: 'dingdan2',
      component: dingdan2
    },
    {
      path: '/daifukuan',
      name: 'daifukuan',
      component: daifukuan
    },
    {
      path: '/dingdanitem1',
      name: 'dingdanitem1',
      component: dingdanitem1
    },
    {
      path: '/dingdanitem2',
      name: 'dingdanitem2',
      component: dingdanitem2
    },
    {
      path: '/dingdanitem3',
      name: 'dingdanitem3',
      component: dingdanitem3
    },
    {
      path: '/dingdanitem4',
      name: 'dingdanitem4',
      component: dingdanitem4
    },
    {
      path: '/dizhi',
      name: 'dizhi',
      component: dizhi
    },
    {
      path: '/chaxun',
      name: 'chaxun',
      component: chaxun
    },
    {
      path: '/shopitem/:name',
      name: 'shopitem',
      component: shopitem
    }
  ]
})
